<template>
  <div class="recupdetails">
    <Back>
      <em slot="title" v-if="this.$store.state.arr[Number(this.$route.query.xiaom)].titletext">
        
        {{this.$store.state.arr[Number(this.$route.query.xiaom)].titletext}}
        
      </em>
    </Back>

    <div class="container">
      <h1>
        <img :src="this.$store.state.arr[Number(this.$route.query.xiaom)].imgurl" alt="" />
      </h1>
      <h2>{{ this.$store.state.arr[Number(this.$route.query.xiaom)].text|filter }}
          <span>  继续阅读</span>
      </h2>
    <h3>
        <i class="iconfont icon-wenhao"></i>
        <span>形成原因</span>
        <i class="iconfont icon-xiajiantou"></i>
    </h3>
    <h3>
        <i class="iconfont icon-wodeyisheng"></i>
        <span>何时就医？</span>
        <i class="iconfont icon-xiajiantou"></i>
    </h3>
    <h3>
        <i class="iconfont icon-recha"></i>
        <span>生活建议</span>
        <i class="iconfont icon-xiajiantou"></i>
    </h3>
    <div class="empty"></div>
    <h4>
        <span>食疗方法</span>
        <span>动作方法</span>
    </h4>
    <RecupDetilsList v-for="(v,i) in 3" :key="i"/>
    <div class="foot iconfont icon-shuyej"></div>
    </div>
  </div>
</template>

<script>
import Back from "../components/back.vue";
import RecupDetilsList from "../components/recupDetilsList.vue";
export default {
  data() {
    return {
      
    };
  },
  components: {
    Back,
    RecupDetilsList
  },
  filters:{
      filter(val){
          if(val.length>57){
            return  val.substr(0,57)+"..."
          }else{
            return  val
          }
      }
  },
  mounted(){
  
  },
  created(){
    this.$store.dispatch("getaxios",{url:"/data/list/xiaoming"})
    console.log(this.$store.state.arr);
  }
};
</script>

<style scoped>
.icon-shuyej{
  font-size: .3rem;
  color: #999;
}
.empty{
    height: .1rem;
    background-color: rgb(240, 238, 238);
}
.container {
  margin-top: 0.5rem;
}
em {
  font-size: 0.24rem;
}
h1 {
  width: 100%;
  text-align: center;
  border-top: 0.01rem solid #999;
}
img {
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 auto;
  padding: 0.2rem 0;
}
h2{
    padding: .2rem;
}
h2 span{
    text-decoration: underline;
    font-weight: 600;
    color: #555;
}
h3{
    padding: 0 0.2rem;
    font-weight: 700;
    height: .45rem;
    border-top:.01rem solid #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
h3 span{
    flex: 1;
    justify-self: flex-start;
    padding-left: .1rem;
}
h3 .iconfont{
  font-size: .22rem;
  font-weight: lighter;
}
h3 .icon-xiajiantou{
  font-size: .16rem;
}
h4{
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: .45rem;
    border-bottom: .01rem solid #999;
}
h4 span:nth-child(1){
    color: green;
}
.foot{
  text-align: center;
  line-height: .5rem;
  width: 100%;
  height: .5rem;
  background-color: rgb(241, 239, 239);
}
</style>